<html>

<head>
<meta http-equiv="Content-Language" content="en-us">
<meta name="GENERATOR" content="Microsoft FrontPage 5.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>UDOs</title>
</head>

<body text="#FFFFFF" bgcolor="#000000" style="font-family: Verdana; font-size: 10pt" link="#00FFFF" vlink="#00FFFF" alink="#00FFFF">

<p><font size="3"><b>User-Defined Objects (UDOs)</b></font></p>
<p>UDOs are new in Solar Vengeance 5.1.&nbsp; They represent objects that you 
can create, manipulate, and interact with in a Scenario.&nbsp; You can even 
assign your own static or animated image to display the UDO on the game map.&nbsp; 
UDOs can optionally be configured so that they are picked up when a
<a href="StarShips.htm">StarShip</a> moves over them.</p>
<p><b><font color="#FFFF00">UDO Properties</font></b></p>
<p>UDOs are accessible from the Game property of the Scenario, which exposes an 
SVGame object instance.&nbsp; SVGame contains the UDOs property, which is a 
List&lt;UDO&gt; that contains all of the UDOs defined in the game.&nbsp; The UDO class 
itself contains the following properties.&nbsp; These properties can be examined 
in VictoryReached and ProcessImpulse, but you should not change the properties 
directly from these method.&nbsp; You CAN set the properties of a UDO in the 
BuildScenario method, after the UDO is created by calling CreateUDO.</p>
<font SIZE="2" COLOR="#00FFFF"><b>
<p>public</b> Point</font><font SIZE="2"><font color="#00FFFF"> </font>Location<br>
<font SIZE="2" COLOR="#00FFFF"><b>public</b> <b>int</b></font> Y<br>
<font SIZE="2" COLOR="#00FFFF"><b>public</b> <b>int</b></font> Y<br>
These properties return the position of the UDO on the map.&nbsp; Do not modify 
these values directly, as the changes you make will not be reflected to other 
players in a MultiPlayer game.&nbsp; To move a UDO during a game, you can use 
the DynamicEvents.MoveUDO method.&nbsp; See the
<a href="Dynamic%20Scenarios.htm">Dynamic Scenarios</a> topic for more details.</p>
</font>
<p><font SIZE="2" COLOR="#00FFFF"><b>public</b> <b>string</b></font><font SIZE="2"> 
Name<br>
The &quot;Name&quot; of the UDO.&nbsp; This is displayed when the player clicks a UDO on 
the map.</font></p>
<font SIZE="2" COLOR="#00FFFF"><b><font SIZE="2">
<p>public string </b></font>Description<b><font SIZE="2" COLOR="#00FFFF"><br>
</font></b></font><font SIZE="2">A description of the UDO.&nbsp; This is 
displayed when a player clicks a UDO on the map.</font></p>
<font SIZE="2" COLOR="#00FFFF"><b>
<p>public</b> <b>string</b></font><font SIZE="2"> ImageFileName<br>
The name of an image file that contains the source image of the UDO.&nbsp; The 
image file should reside in the Scenarios folder with the Scenario source code 
files.&nbsp; The image can contain multiple frames for animation purposes.</font></p>
<font SIZE="2" COLOR="#00FFFF"><b>
<p>public</b> <b>int</b></font><font SIZE="2"> FrameCount<br>
The number of frames contained in the UDO's image file.</font></p>
<font SIZE="2" COLOR="#00FFFF"><b>
<p>public</b> <b>int</b></font><font SIZE="2"><font color="#00FFFF"> </font>
FrameDelay<br>
The number of animation cycles that will elapse before an animated UDO changes 
to a new frame of animation.</font></p>
<font SIZE="2" COLOR="#00FFFF"><b>
<p>public</b> <b>bool</b></font><font SIZE="2"><font color="#00FFFF"> </font>
RandomizeFrames<br>
If set to return true, an animated UDO will pick a random frame when it is time 
for it to switch to the next frame in its animation cycle.</font></p>
<font SIZE="2" COLOR="#00FFFF"><b>
<p>public</b> <b>bool</b></font><font SIZE="2"> RandomizeInterval<br>
If set to true, an animated UDO will randomize the delay in its animation cycle.&nbsp; 
Each frame will be assigned a random number of animation cycles between 1 and 
FrameDelay.</font></p>
<font SIZE="2" COLOR="#00FFFF"><b>
<p>public</b> <b>bool</b></font><font SIZE="2"> AutoPickUp<br>
If set to true, this UDO will automatically be &quot;picked up&quot; by any StarShip that 
moves over it.&nbsp; UDOs that are carried by StarShips move with the carrying 
StarShip until the StarShip unloads them using the Eject command.</font></p>
<font SIZE="2" COLOR="#00FFFF"><b>
<p>public</b> <b>bool</b></font><font SIZE="2"><font color="#00FFFF"> </font>
IgnoreBlackHoles<br>
This property determined whether or not the UDO is pulled in by BlackHoles.&nbsp; 
The default value is false, indicating that the UDO is subject to BlackHoles' 
gravitational pull, and the consequences of being pulled in.</font></p>
<font SIZE="2" COLOR="#00FFFF"><b>
<p>public</b> <b>bool</b></font><font SIZE="2"> IsTaggable<br>
Set this value to true to indicate that the UDO is able to be tagged by
<a href="InkSpot.htm">InkSpots</a>.</font></p>
<font SIZE="2" COLOR="#00FFFF"><b>
<p>public</b> StarShip</font><font SIZE="2"> Carrier<br>
Returns the StarShip that is carrying the UDO, or null of it is not being 
carried.</p>
</font>
<p><b><font color="#FFFF00">Creating UDOs</font></b></p>
<p>You can create UDOs in one of two ways.&nbsp; First, by calling the CreateUDO 
method in the <a href="Scenario%20Programming.htm">BuildScenario</a> method.&nbsp; 
This allows you to pre-populate the Scenario with one or more UDOs from the 
beginning.&nbsp; In the CreateUDO method, you specify some of the UDO's 
properties in the method call.&nbsp; The method itself returns a UDO object, and 
you can set further properties of the UDO as needed using this object instance.</p>
<p>The second way of creating UDOs is by calling the CreateUDO method of the 
DynamicEvents property, from within the ProcessImpulse method.&nbsp; This allows 
you to dynamically create new UDOs after a game begins.&nbsp; See the
<a href="Dynamic%20Scenarios.htm">Dynamic Scenarios</a> topic for more 
information.</p>
<p><b><font color="#FFFF00">Picking up and Ejecting UDOs</font></b></p>
<p>If the UDOs in your Scenario are configured for AutoPickup, they will be 
&quot;picked up&quot; by any StarShip that moves on top of them.&nbsp; UDOs that are being 
carried in this way move with the StarShip, until the player releases them using 
the Eject Object(s) command during play.&nbsp; A StarShip can carry any number 
of UDOs.&nbsp; You can use UDOs as part of a Scenario's Victory Conditions by 
overriding the Scenario class' VictoryReached method and exmining the location 
of the UDOs in the game.&nbsp; See the CollectTheScientists.cs Scenario file for 
an example that uses UDOs as the Victory Condition.</p>
<p>If you set your UDOs' AutoPickup property to false, then they will not be 
picked up automatically.&nbsp; You can use the DynamicEvents UDO methods to 
explicitly pick up and eject UDOs in your Scenario's ProcessImpulse method.&nbsp; 
See the <a href="Dynamic%20Scenarios.htm">Dynamic Scenarios</a> topic for more 
information.</p>
<p>&nbsp;</p>

</body>

</html>